package com.sservice.service.service;

import com.sservice.model.entity.Order;
import com.sservice.model.entity.OrderAdvanceReceipt;
import com.sservice.model.vo.AdvanceReceiptVo;
import com.sservice.model.vo.OrderAdvanceReceiptVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by suweiming on 2017/12/20.
 */

public interface IOrderAdvanceReceiptService {

    int insert(OrderAdvanceReceipt record);

    int insertSelective(OrderAdvanceReceipt record);

    /**
     * 查看付款单使用情况
     *
     * @param record
     * @return
     */
    List<OrderAdvanceReceiptVo> selectByAdvanceId(OrderAdvanceReceipt record);

    public boolean returnUnnecessaryOrderMoney(Order order);

    public int getNext(int next, int pointer, String[] payCash, BigDecimal total);

    /**
     * 通过预付款单进行付款
     *
     * @param record
     * @return
     */
    Object payByAdvanceReceipt(OrderAdvanceReceiptVo record);

    /**
     * 销售订单退款
     * @param record
     * @return
     */
    Object rebackByOrderAdvanceReceipt(OrderAdvanceReceipt record);

    /**
     * 批量付款
     *
     * @param record
     * @return
     */
    int payInBatch(List<OrderAdvanceReceipt> record);

    /**
     * 其他应收款批量付款
     *
     * @param record
     * @return
     */
    int payInBatchOtherOrder(List<OrderAdvanceReceipt> record);

    /**
     * 余额付款销售订单
     *
     * @param record
     * @return
     */
    Object payOrder(OrderAdvanceReceiptVo record);

    /**
     * 锁定预付款单
     *
     * @param record
     * @return
     */
    Object lockAdvanceBill(OrderAdvanceReceiptVo record, int locker);

    /**
     * 领导审核
     *
     * @param record
     * @return
     */
    Object check(AdvanceReceiptVo record);

    /***
     * 财务付款
     * @param record
     * @return
     */
    Object pay(AdvanceReceiptVo record);

    /**
     * 财务退款
     * type 删除银行付款的方式 0 删除 1转化为预付款单
     * @param record
     * @return
     */
    Object reback(AdvanceReceiptVo record);

    /**
     * 其他
     */

    Object otherLockAdvanceBill(OrderAdvanceReceiptVo record, int locker);

    Object otherPay(AdvanceReceiptVo record);

    Object otherCheck(AdvanceReceiptVo record);


}
